package self_test;

class Dog {
	public void bark() { System.out.println("dog woof "); }
}

class Hound extends Dog {
	public void sniff() { System.out.println("hound sniff ");  }
	public void bark() { System.out.println("hound bark "); }
}

public class DogShow {
	public static void main(String[] args) { 
		new DogShow().go(); 
		
		new DogShow().doStuff( (Dog)new Hound() ); 
		Dog d = new Hound();
		new DogShow().doStuff(d);
	}
	void go() {
		new Hound().bark();
		((Dog) new Hound()).bark();
	}
	void doStuff(Dog d) { System.out.println("dog is passed "); }
	void doStuff(Hound h) { System.out.println("hound is passed "); }
}
